# Maintainer: David Runge <dvzrv@archlinux.org>
# Contributor: Martin C. Doege <mdoege at compuserve dot com>
# Contributor: Ray Rashif <schiv@archlinux.org>
# Contributor: Shinlun Hsieh <yngwiexx@yahoo.com.tw>

pkgname=liblscp
pkgver=0.9.11
pkgrel=1
pkgdesc="LinuxSampler Control Protocol C++ library"
arch=(loong64 x86_64)
url="https://github.com/rncbc/liblscp"
license=(LGPL-2.1-or-later)
depends=(glibc)
makedepends=(cmake)
provides=(liblscp.so)
source=($url/archive/${pkgname}_${pkgver//./_}/$pkgname-${pkgname}_${pkgver//./_}.tar.gz)
sha512sums=('cbeb9e579f7de3232c6069586509c73b647e8b8a8ab73ed6cadc454ddc10616c289709e4da1dc04e485f9836ba6b095875ab2c1ef47f02890a358b76f39cfd8b')
b2sums=('d2fb85e10d2358f94f24231af3c09f11b5ebb0af68b79fb57656b83fd9110853d9a7f453555a4cc6d1cac1ef5a3e1527bf3dac7dbaacc86221edcdce8f3ae682')

build() {
  local cmake_options=(
    -B build
    -D CMAKE_BUILD_TYPE=None
    -D CMAKE_INSTALL_PREFIX=/usr
    -S $pkgname-${pkgname}_${pkgver//./_}
    -W no-dev
  )

  cmake "${cmake_options[@]}"
  cmake --build build --verbose
}

package() {
  DESTDIR="$pkgdir" cmake --install build
  install -vDm 644 $pkgname-${pkgname}_${pkgver//./_}/{ChangeLog,README} -t "$pkgdir/usr/share/doc/$pkgname/"
}

